<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Role extends Model {

    protected $fillable = ['role_name', 'role_des', 'role_pid'];

    public function child()
    {
        return $this->hasMany('App\Models\Role', 'role_pid', 'id');
    }

    public function parent()
    {
        return $this->hasMany('App\Models\Role', 'id', 'role_pid');
    }
}
